package cn.edu.sptc.sms_lioayu.service.impl;

import cn.edu.sptc.sms_lioayu.dao.MajorMapper;
import cn.edu.sptc.sms_lioayu.entity.Major;
import cn.edu.sptc.sms_lioayu.service.MajorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import  java.util.List;
@Service
public class MajorServicelmpl implements MajorService{

    @Autowired
    private  MajorMapper majorMapper;

    @Override
    public boolean insert(Major major) {
        return majorMapper.insert(major) > 0;
    }

    @Override
    public boolean delete(Long id) {
        return majorMapper.delete(id) > 0;
    }

    @Override
    public boolean update(Major major) {
        return majorMapper.update(major) > 0;
    }

    @Override
    public Major selectByID(Long id) {
        return majorMapper.selectByID(id);
    }

    @Override
    public List<Major> selectAll() {
        return majorMapper.selectAll();
    }
}
